home *** CD-ROM | disk | FTP | other *** search
- Path: news.primenet.com!jstern
- From: jstern@primenet.com (Josh Stern)
- Newsgroups: comp.lang.c++
- Subject: Re: Functions in functions using function objects
- Date: 5 Apr 1996 15:25:01 -0700
- Organization: Primenet Services for the Internet
- Sender: root@primenet.com
- Message-ID: <4k46jt$q5@nnrp1.news.primenet.com>
- References: <4k1nus$8h1@barad-dur.nas.com>
- X-Posted-By: jstern@usr2.primenet.com
-
- Matt Scott <gldnspud@kali.nas.com> wrote:
- >I was experimenting with various C++ constructs lately, and I thought
- >of an idea that might help me implement a Pascal construct that I
- >really enjoy but that isn't present in C or C++.
- >
- >I always liked the fact that Pascal was a block-structured language,
- >and that you could have functions (and procedures, for all you Pascal
- >types out there) inside other functions, which would be local to only
- >those functions that they were defined in.
- >
- >Since C and C++ are not block-structured, this is impossible. I did
- >find a way around it, though:
-
- You might want to take a look at namespaces in C++.
- Offhand, I can't think of any reason for defining
- a function within a function that couldn't be handled
- using namespaces.
-
-
- - Josh
-
-
- --
- -------------------------------------------------------------------------------
- jstern
- jstern@primenet.com
- -------------------------------------------------------------------------------
-